<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div style="text-align: center; color: greenyellow; font-size: large;">关于数组函数的几个应用</div>

    <script>
        let arrA = [1,2,3,4,5,6,7]
        let resArrA = arrA.filter(string=>string%2 === 1)            
        console.log(resArrA)

        let resArrB =arrA.find(string => string % 2 === 1 && string != 1)
        console.log(resArrB)

        let resArrC =arrA.map((value,index,arr)=>{
            if(value % 2 != 0){
                return value + "是奇数"
            }else return value + "是偶数"
        })
        console.log(resArrC)
console.log("----------------------------------------------------")
        console.log(arrA.map((value,index,arr)=>{
            if(value % 2 != 0){
                return value + "是奇数"
            }else return value + "是偶数"
        }))
    </script>
</body>
</html>